package com.shy.spring.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Transactional
    public Integer insert() {
        int result = jdbcTemplate.update("insert into t_user(username) values(?)", "shy22");
        Integer ss = 1 / 0;
        return result;
    }
}
